{% extends 'base.html' %}
{% load pp_url %}
{% load solutiontags %}
{% load argumenttags %}

{% block title %}
solution detail
{% endblock title %}
{% block content %}

    
{% pp_get_solution object=request.object %}
<h2>Details for {{pp_solution.solution.name|title}}</h2>   
    <ul>
        <li>{{pp_solution.solution.text }}</li>
        <li><a href="/upvote/{{pp_solution.solution.topic}}/{{pp_solution.solution.id}}">Support: {{ pp_solution.upvotes }}</a></li>
        <li><a href="/neutvote/{{pp_solution.solution.topic}}/{{pp_solution.solution.id}}">Neutral: {{ pp_solution.neutralvotes }}</a></li>
        <li><a href="/downvote/{{pp_solution.solution.topic}}/{{pp_solution.solution.id}}">Oppose: {{ pp_solution.neutralvotes }}</a></li>
    </ul>
                
            {% pp_get_arg_types %}

<!--Display Arguments for this solution-->

               {% for arg_type in pp_argumentation.arg_type_list %}

                    {{arg_type}} <br>

                    {% pp_get_argument_list solution=pp_solution.solution arg_type=arg_type %}

                        {% for arg in pp_argumentation.argument_list %}
                            {{arg.name}} <br>
                            {{arg.text}} <br>

                        {% endfor %}

                    {% endpp_get_argument_list %}

<!--Form for adding new arguments for this solution-->
                {% pp_argument_form POST=request.POST path=request.path user=request.user object=pp_solution.solution arg_type=arg_type %}

               <div id = "add">
               <hr />
               {{ pp_argumentation.form.errors }}
	            <form method="post" action="">
                    {{ pp_argumentation.form.name }}<br>
                    {{ pp_argumentation.form.text }}<br>
		            {% csrf_token %}
                  <input type="submit" value="Submit">
	            </form>
	            </div>

                {% endpp_argument_form %}

            {% endfor %}

            {% endpp_get_arg_types %}


{% endpp_get_solution %}


{% endblock content %}




